package com.ruibang.glass.quality.controller.manage;

import com.ruibang.glass.quality.domain.req.IMRControlDiagramReq;
import com.ruibang.glass.quality.domain.req.SpcProcessDataReq;
import com.ruibang.glass.quality.service.SpcService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @Author: songJinKang
 * @CreateTime: 2023-10-19  10:49
 * @Description: TODO:spc计算控制器
 * @Version: 1.0
 */
@RestController
@RequestMapping("/api/spc")
@Api(value = "spc计算控制器", tags = {"spc计算控制器"})
public class SpcController {

    @Autowired
    private SpcService spcService;

    @GetMapping("/getIMRInspectionItems")
    @ApiOperation(value = "获取IMR数据检验项", notes = "获取IMR数据检验项")
    public ResultBody getIMRInspectionItems() {
        return spcService.getIMRInspectionItems();
    }

    @PostMapping("/imrAlgorithm")
    @ApiOperation(value = "IMR控制图算法", notes = "IMR控制图算法")
    public ResultBody IMRAlgorithm(@RequestBody @Valid IMRControlDiagramReq imrControlDiagramReq) {
        return spcService.IMRAlgorithm(imrControlDiagramReq);
    }

    @PostMapping("/capability")
    @ApiOperation(value = "过程能力算法", notes = "过程能力算法")
    public ResultBody capability(@RequestBody @Valid SpcProcessDataReq spcProcessDataReq) {
        return spcService.capability(spcProcessDataReq);
    }
}
